package com.ruoyi.qd.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.KeyType;
import com.mybatisflex.annotation.Table;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.math.BigDecimal;
import java.util.Date;

/**
 * 订单对象 qd_order
 * 
 * @author tushiguang
 * @date 2024-07-24
 */
@Accessors(chain = true)
@Data(staticConstructor = "create")
@EqualsAndHashCode(callSuper = true)
@Table("qd_order")
public class Order extends BaseEntity<Order> {
    private static final long serialVersionUID = 1L;

    /**
     * id
     */
    @Id(keyType= KeyType.Auto)
    private Long id;

    /**
     * 订单编号
     */
    @Excel(name = "订单编号")
    private String orderNo;

    /**
     * 用户id
     */
    @Excel(name = "用户id")
    private Long userId;

    /**
     * 机器人id
     */
    @Excel(name = "机器人id")
    private Long robotId;

    /**
     * 订单金额
     */
    @Excel(name = "订单金额")
    private BigDecimal money;

    /**
     * 订单状态（1已支付 2已使用 3用户取消 4过期退款）
     * @see com.ruoyi.qd.enums.OrderStatusEnum
     */
    @Excel(name = "订单状态", readConverterExp = "1=已支付,2=已使用,3=用户取消,4=过期退款")
    private String status;

    /**
     * 预约时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "预约时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date appointmentTime;

}
